package com.sayimo.maker.user.dao.impl;

import org.springframework.stereotype.Repository;

import com.sayimo.framework.database.mybatis.AbstractMybatisBaseDao;
import com.sayimo.framework.exception.DaoException;
import com.sayimo.maker.user.dao.SmsVerifyCodeInterfaceDao;
import com.sayimo.maker.user.vo.SmsVerifyCode;


/**
 * @Project: sayimoWeixinWeb
 * @ClassName: SmsVerifyCodeInterfaceImplDao
 * @Description: 短信验证码Dao
 * @Author:	王瑞清
 * @Date:	日期：2015年8月18日  时间：下午3:40:36
 * @Version 1.0.0
 */
@Repository(value="smsVerifyCodeInterfaceImplDao")
public class SmsVerifyCodeInterfaceImplDao extends AbstractMybatisBaseDao<SmsVerifyCode> implements SmsVerifyCodeInterfaceDao{

	public int insertVerifyCode(SmsVerifyCode code) throws DaoException {
		return this.mybatisInterfaceBaseDao.insert("com.sayimo.maker.user.dao.SmsVerifyCodeInterfaceDao.insertVerifyCode", code);
	}

	public int updateVerifyCode(SmsVerifyCode code) throws DaoException {
		return this.mybatisInterfaceBaseDao.update("com.sayimo.maker.user.dao.SmsVerifyCodeInterfaceDao.updateVerifyCode", code);
	}

	public SmsVerifyCode querySmsVerifyCodeByCond(SmsVerifyCode code) throws DaoException {
		return this.mybatisInterfaceBaseDao.get("com.sayimo.maker.user.dao.SmsVerifyCodeInterfaceDao.querySmsVerifyCodeByCond", code);
	}

	/**
	 * @Package com.sayimo.maker.user.dao.impl
	 * @Author 谭新
	 * @MethodName: updateSmsVerifyCodeByCond
	 * @Description:验证成功后将验证码失效
	 * @Date 2017年3月27日,下午3:54:10
	 */
	@Override
	public Integer updateSmsVerifyCodeByCond(SmsVerifyCode code)
			throws DaoException {

		return this.mybatisInterfaceBaseDao.update("com.sayimo.maker.user.dao.SmsVerifyCodeInterfaceDao.updateSmsVerifyCodeByCond", code);
	}
}
